package com.gjy.pd.specification;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-01-17 14:38:04
 */
public class OrSpecification extends CompositeSpecification {
    private final ISpecification left;
    private final ISpecification right;

    public OrSpecification(ISpecification left, ISpecification right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public boolean isSatisfiedBy(Object candidate) {
        return left.isSatisfiedBy(candidate) || right.isSatisfiedBy(candidate);
    }
}
